Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseCorrectCasing: Do not correct applications or script paths at all #1255

Merged

Conversation

bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Jun 6, 2019

PR Summary

Fixes #1206
When PowerShell starts at a directory and a script has an expression like the dot operator to a relative path that exists, Get-Command returns an object and makes it correct the path to the file name in the new UseCorrectCasing formatting rule (this rule is turned off by default in the vs code editor). We do not want to change paths at all (there could even be path casing issues if someone develops on Windows for example), therefore the exclusion applies. It was hard to write a test case for this but the same bug also occurs when using a UNC file path and this was chosen to be the test case for the written regression test.

In general we also found more edge cases of application paths being corrected as well and takie this logic out as well due to the time pressure of shipping 1.18.1 It seemed something easy for free at first but that was actually not the intent of the rule and it seems it is anon-trivial feature that someone might want to add later but not now.

PR Checklist

@bergmeister bergmeister added this to the 1.18.1 milestone Jun 6, 2019
@bergmeister bergmeister marked this pull request as ready for review June 6, 2019 17:31
@bergmeister bergmeister changed the title UseCorrectCasing: Preserve script paths UseCorrectCasing: Preserve external script paths (relative or UNC) Jun 6, 2019
@bergmeister bergmeister changed the title UseCorrectCasing: Preserve external script paths (relative or UNC) UseCorrectCasing: Preserve external script paths to address issue with relative or UNC paths getting changed Jun 6, 2019
@bergmeister bergmeister changed the title UseCorrectCasing: Preserve external script paths to address issue with relative or UNC paths getting changed UseCorrectCasing: Do not correct applications or script paths at all Jun 6, 2019
@JamesWTruher JamesWTruher merged commit 2cc40ec into PowerShell:development Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto Format corrupting paths in my scripts
2 participants